﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <div id="vue1">
        <div v-bind:class="classObject('1')"></div>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
    <script>
        var vm = new Vue({
            el: '#vue1',
            data: {
                title: "init_title",
            },
            computed:
            {
                classObject: function(){
                    return function (type) {
                        return {
                            "height": "100px",
                            "border":"1px solid #ddd"
                        }
                    }
                }
            },
            methods: {
                changeTitle: function () {
                    this.title = this.title + "_change_title" + this.getValue('aabcdd');
                },
                getValue: function (a) {
                    return a + "getValue";
                },
                post: function () {
                    //发送 post 请求
                    $.post("", JSON.stringify({}), function (rs) {
                        //$.each(function (index, item) {});
                        console.log(rs);
                    });
                }
            },
        });
    </script>
</body>
</html>